<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>消费者画像</title>
    <link rel="stylesheet" href="${contextPath}/static/statistics/css/bootstrap.min.css">
    <!-- <link rel="stylesheet" href="https://unpkg.com/iview@2.12.0/dist/styles/iview.css"> -->

    <script src="${contextPath}/static/statistics/js/jquery.js"></script>
    <script src="${contextPath}/static/statistics/js/bootstrap.min.js"></script>
    <script src=${contextPath}/static/layer/layer.js></script>
    <script src="${contextPath}/static/statistics/js/echarts.min.js"></script>

    <script type="text/javascript" src="http://vuejs.org/js/vue.min.js"></script>
    <script type="text/javascript" src="https://unpkg.com/iview@2.12.0/dist/iview.min.js"></script>

    <style type="text/css">
        body {
            background-color: #0c2a52;
        }
        .zc-container {
            text-align: center;
        }
        .zc-title {

        }
        .col-left {
            text-align: left;
        }
        .col-center {
            text-align: center;
        }

        .zc-zb-box {
            overflow: hidden;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -ms-flex-wrap: wrap;
            flex-wrap: wrap;
            -webkit-box-align: baseline;
            -ms-flex-align: baseline;
            align-items: baseline;
            padding: 20px;
        }
        .zc-zb-name {
            font-size: 15px;
            color: #dcdcdc;
            line-height: 16px;
        }
        .zc-zb-num {
            font-size: 37px;
            color: #fff;
            line-height: 48px;
            margin-left: 20px;
        }
        .zc-zb-pc {
            font-size: 25px;
            color: green;
            line-height: 35px;
            margin-left: 15px;
        }
        .zc-zb-change {
            margin-left: 10px;
        }
        .zc-map {
        }
        .right-zb-box{

        }

        @media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
            .masked{
                background-image: -webkit-linear-gradient(left, #147B96, #E6D205 25%, #147B96 50%, #E6D205 75%, #147B96);
                -webkit-text-fill-color: transparent;
                -webkit-background-clip: text;
                -webkit-background-size: 200% 100%;
                -webkit-animation: masked-animation 4s infinite linear;
            }
        }
        @-webkit-keyframes masked-animation {
            0%  { background-position: 0 0;}
            100% { background-position: -100% 0;}
        }

        .zb-box {
            position: relative;
            height: 120px;
            width: 260px;
            left: 50%;
            transform: translate(-50%,0%);
        }
        .zb-jj {
            width: 0px;
            height: 0px;
            border-top: 30px solid transparent;
            border-right: 30px solid transparent;
            border-bottom: 30px solid transparent;
            border-left: 18px solid #2769c1;
            position: absolute;
            top: 20px;
            left: 240px;
        }
        .zb-nr {
            position: absolute;
            top:20px;
            left: 0px;
            width: 240px;
            height: 60px;
            background-color: #2769c1;
            padding-left: 100px;
            text-align: left;
        }
        .zb-title {
            margin-top: 5px;
            color: #fff;
        }
        .zb-num {
            color: red;
            font-size: 26px;
        }
        .zb-image-b {
            width: 80px;
            height: 60px;
            position: absolute;
            top: 0px;
            left: 0px;
            background-color: #0d1365;
        }
        .zb-image {
            width: 36px;
            height: 36px;
            margin-top: 12px;
        }
    </style>
    <style>
        @keyframes warn {
            0% {
                transform: scale(0.3);
                -webkit-transform: scale(0.3);
                opacity: 0.0;
            }

            25% {
                transform: scale(0.3);
                -webkit-transform: scale(0.3);
                opacity: 0.1;
            }

            50% {
                transform: scale(0.5);
                -webkit-transform: scale(0.5);
                opacity: 0.3;
            }

            75% {
                transform: scale(0.8);
                -webkit-transform: scale(0.8);
                opacity: 0.5;
            }

            100% {
                transform: scale(1);
                -webkit-transform: scale(1);
                opacity: 0.0;
            }
        }

        @keyframes warn1 {
            0% {
                transform: scale(0.3);
                -webkit-transform: scale(0.3);
                opacity: 0.0;
            }

            25% {
                transform: scale(0.3);
                -webkit-transform: scale(0.3);
                opacity: 0.1;
            }

            50% {
                transform: scale(0.3);
                -webkit-transform: scale(0.3);
                opacity: 0.3;
            }

            75% {
                transform: scale(0.5);
                -webkit-transform: scale(0.5);
                opacity: 0.5;
            }

            100% {
                transform: scale(0.8);
                -webkit-transform: scale(0.8);
                opacity: 0.0;
            }
        }

        .dh-container {
            position: relative;
            width: 40px;
            height: 40px;
            left: 10px;
            top: 10px;
        }
        /* 保持大小不变的小圆点 */
        .dot {
            position: absolute;
            width: 15px;
            height: 15px;
            left: 13px;
            top: 12px;
            -webkit-border-radius: 50%;
            -moz-border-radius: 50%;
            border: 1px solid #33ccff;
            border-radius: 50%;
            background-color:#33ccff; /* 实心圆 ，如果没有这个就是一个小圆圈 */
            z-index: 2;
        }
        /* 产生动画（向外扩散变大）的圆圈 第一个圆 */
        .pulse {
            position: absolute;
            width: 40px;
            height: 40px;
            left: 0px;
            top: 0px;
            border: 1px solid #3399ff;
            -webkit-border-radius: 50%;
            -moz-border-radius: 50%;
            border-radius: 50%;
            z-index: 1;
            opacity: 0;
            -webkit-animation: warn 2s ease-out;
            -moz-animation: warn 2s ease-out;
            animation: warn 2s ease-out;
            -webkit-animation-iteration-count: infinite;
            -moz-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
            box-shadow: 1px 1px 30px #3399ff; /* 阴影效果 */
        }
        /* 产生动画（向外扩散变大）的圆圈 第二个圆 */
        .pulse1 {
            position: absolute;
            width: 40px;
            height: 40px;
            left: 0px;
            top: 0px;
            border: 1px solid #3399ff;
            -webkit-border-radius: 50%;
            -moz-border-radius: 50%;
            border-radius: 50%;
            z-index: 1;
            opacity: 0;
            -webkit-animation: warn1 2s ease-out;
            -moz-animation: warn1 2s ease-out;
            animation: warn1 2s ease-out;
            -webkit-animation-iteration-count: infinite;
            -moz-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
            box-shadow: 1px 1px 30px #3399ff; /* 阴影效果 */
        }
    </style>
</head>
<body>
<div class="container-fluid zc-container">
    <div class="row">
        <div class="col-sm-12 zc-title">
            <h1 style="color: #e2e2e2;">消费者画像<small>消费者维度数据</small></h1>
        </div>
    </div>
    <hr style="border-top: 1px solid #ccc;">
    <div class="row">
        <div class="col-sm-3 con-left" id="app">

            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        消费者总数
                    </div>
                    <div class="zb-num" style="color:#db444e;">
                        {{numData.consumerTotal}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a1.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        男性消费者
                    </div>
                    <div class="zb-num" style="color:#97d209;">
                        {{numData.manTotal}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a2.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        女性消费者
                    </div>
                    <div class="zb-num" style="color:#26f3e6;">
                        {{numData.womanTotal}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a3.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        18到35岁
                    </div>
                    <div class="zb-num" style="color:#db444e;">
                        {{numData.age1Total}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a4.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        35到55岁
                    </div>
                    <div class="zb-num" style="color:#a6a737;">
                        {{numData.age2Total}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a5.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        55岁以上
                    </div>
                    <div class="zb-num" style="color:#26f3e6;">
                        {{numData.age3Total}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a3.png" class="zb-image"/>
                </div>
            </div>

        </div>
        <div class="col-sm-6 col-center">
            <div class="zc-map" id="zc-map"></div>
            <table class="table table-bordered table-condensed" style="color: #fb8989;">
                <thead>
                </thead>
                <tbody>
                <tr>
                    <th><div style="width: 15px;height: 15px;border-radius: 50%;background-color: #33ccff"></div></th>
                    <td>50次以上</td>
                    <th><div style="width: 15px;height: 15px;border-radius: 50%;background-color: #ff8e00"></div></th>
                    <td>30-50次</td>
                    <th><div style="width: 15px;height: 15px;border-radius: 50%;background-color: #ff0000"></div></th>
                    <td>20-30次</td>
                    <th><div style="width: 15px;height: 15px;border-radius: 50%;background-color: #b0ff33"></div></th>
                    <td>10-20次</td>
                    <th><div style="width: 15px;height: 15px;border-radius: 50%;background-color: #334cff"></div></th>
                    <td>10次以下</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="col-sm-3">
            <div class="row statistics-box">
                <div class="col-sm-12 main" id="main1"></div>
            </div>
            <div class="row statistics-box">
                <div class="col-sm-12 main" id="main2"></div>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=ec3688cc2547017ad39dd55153d18b85"></script>
<script>

    // 高度设置
    $('#zc-map').height($('#zc-map').width()*1);
    {
        var total = $(document).height();
        $('.main').height(total*0.36);
    }


    //初始化地图
    var map = new AMap.Map('zc-map',{
        resizeEnable: true,
        zoom: 12,
        mapStyle: 'amap://styles/grey',
        center: [116.39,39.9]//new AMap.LngLat(116.39,39.9)
    });
    AMap.plugin(['AMap.ToolBar', 'AMap.Scale', 'AMap.MapType'], function() {
        toolBar = new AMap.ToolBar();  //工具条
        scale = new AMap.Scale();    //比例尺
        map.addControl(toolBar);
        map.addControl(scale);
    });
    var infoWindow = new AMap.InfoWindow();

    //初始化统计图
    var myChart1 =  echarts.init($("#main1")[0]);
    var myChart2 =  echarts.init($("#main2")[0]);

    //vue实例
    new Vue({
        el: '#app',
        data: {
            markerList : [],
            gongYe:[{name:'a',child:[{name:'aa',code:'aa'}]},
                {name:'b',child:[{name:'bb',code:'bb'}]}],
            product:[],
            selectKey: '',
            selectValue: '',
            numData:{
                consumerTotal: 0,
                manTotal : 0,
                womanTotal : 0,
                age1Total : 0,
                age2Total : 0,
                age3Total : 0
            }
        },
        computed: {

        },
        watch: {

        },
        mounted: function () {
            //this.getInitData();
            this.getData();
        },
        methods: {
            getInitData : function () {
                var vm = this;
                $.ajax({
                    url: '${contextPath}/shop/getIndustryInitData',
                    type: 'get',
                    dataType: 'json',
                    success: function (data) {
                        if (data.success) {
                            var gys = data.data.gys;
                            vm.gongYe = gys;
                        } else {
                            layer.msg(data.message)
                        }
                    },
                    error: function (error) {
                        layer.msg("网络错误")
                    }
                })
            },
            getData: function () {

                var vm = this;
                layer.load(1);
                $.ajax({
                    url: '${contextPath}/shop/getIndustryData',
                    type: 'post',
                    dataType: 'json',
                    data: {
                        stringMap: {

                        }
                    },
                    success: function (data) {
                        layer.closeAll('loading');
                        if (data.success) {

                            var shopLocation = data.data.shopLocation;
                            var goYeYearData = data.data.goYeYearData;

                            vm.updateNumData(data.data);
                            vm.updateMap(shopLocation);
                            vm.updateMain1Data(goYeYearData);
                            vm.updateMain2Data(goYeYearData);




                        } else {
                            layer.msg(data.message)
                        }
                    },
                    error: function (error) {
                        layer.closeAll('loading');
                        layer.msg("网络错误")
                    }
                })
            },
            updateNumData : function (data) {
                data = {
                consumerTotal: 5678,
                    manTotal : 4890,
                    womanTotal : 788,
                    age1Total : 2837,
                    age2Total : 1938,
                    age3Total : 1147};

                this.numData.consumerTotal = data.consumerTotal ? data.consumerTotal : '0';
                this.numData.manTotal = data.manTotal ? data.manTotal : '0';
                this.numData.womanTotal = data.womanTotal ? data.womanTotal : '0';
                this.numData.age1Total = data.age1Total ? data.age1Total : '0';
                this.numData.age2Total = data.age2Total ? data.age2Total : '0';
                this.numData.age3Total = data.age3Total ? data.age3Total : '0';
            },
            updateMap : function (dataArray) {

                dataArray = [
                    {LEVEL:5,CUST_CODE:"520201105930",CUST_NAME:"明旺食品经营部",SHORT_NAME:"钟山",SHOP_NAME:"明旺食品经营部",SHOP_ID:"10972",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.57318",LONGITUDE:"104.88262",IS_EXP:"1"},
                    {LEVEL:5,CUST_CODE:"520201105938",CUST_NAME:"钟山区黔兰食品经营部",SHORT_NAME:"钟山",SHOP_NAME:"钟山区黔兰食品经营部",SHOP_ID:"13165",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.57335",LONGITUDE:"104.88202",IS_EXP:"1"},
                    {LEVEL:4,CUST_CODE:"520201106803",CUST_NAME:"钟山区祥瑞烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"钟山区祥瑞烟酒店",SHOP_ID:"11436",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.56225",LONGITUDE:"104.90809",IS_EXP:"1"},
                    {LEVEL:4,CUST_CODE:"520201103571",CUST_NAME:"连兴平价店",SHORT_NAME:"钟山",SHOP_NAME:"连兴平价店",SHOP_ID:"17318",ADDRESS:"贵州省六盘水市钟山区幸福路191号楼附近",LATITUDE:"26.5803",LONGITUDE:"104.89989",IS_EXP:"1"},
                    {LEVEL:4,CUST_CODE:"520201101538",CUST_NAME:"吴远伦",SHORT_NAME:"钟山",SHOP_NAME:"吴远伦",SHOP_ID:"17428",ADDRESS:"贵州省六盘水市钟山区红岩路与麒麟路交叉口西北100米",LATITUDE:"26.61788",LONGITUDE:"106.64454",IS_EXP:"0"},
                    {LEVEL:3,CUST_CODE:"520201106401",CUST_NAME:"洪英百货",SHORT_NAME:"钟山",SHOP_NAME:"洪英百货",SHOP_ID:"17563",ADDRESS:"贵州省六盘水市钟山区凤凰东路1号附14号",LATITUDE:"26.61788",LONGITUDE:"106.6445",IS_EXP:"0"},
                    {LEVEL:3,CUST_CODE:"520201101665",CUST_NAME:"平俊便利店",SHORT_NAME:"钟山",SHOP_NAME:"平价超市",SHOP_ID:"15245",ADDRESS:"贵州省六盘水市钟山区人民东路与金水南路交叉口东200米",LATITUDE:"26.56108",LONGITUDE:"104.91973",IS_EXP:"1"},
                    {LEVEL:3,CUST_CODE:"520201107118",CUST_NAME:"馨怡副食店",SHORT_NAME:"钟山",SHOP_NAME:"贵州省六盘水市钟山区教场贵仁路288号",SHOP_ID:"17489",ADDRESS:"贵州省六盘水市钟山区麒麟路11号附80号(布雷尔利旗舰店)",LATITUDE:"26.58439",LONGITUDE:"104.86151",IS_EXP:"0"},
                    {LEVEL:2,CUST_CODE:"520201101465",CUST_NAME:"林菊",SHORT_NAME:"钟山",SHOP_NAME:"麦架镇王二便利店",SHOP_ID:"3764",ADDRESS:"贵州省贵阳市白云区麦架镇金鱼桥水库",LATITUDE:"26.71217",LONGITUDE:"106.62284",IS_EXP:"2"},
                    {LEVEL:2,CUST_CODE:"520201101413",CUST_NAME:"黄顺先",SHORT_NAME:"钟山",SHOP_NAME:"黄顺先",SHOP_ID:"17150",ADDRESS:"贵州省六盘水市钟山区杨柳街道巴西警察署七号点社区警务室",LATITUDE:"26.59209",LONGITUDE:"104.8922",IS_EXP:"1"},
                    {LEVEL:2,CUST_CODE:"520201103346",CUST_NAME:"赵德芬",SHORT_NAME:"钟山",SHOP_NAME:"赵德芬",SHOP_ID:"17298",ADDRESS:"贵州省六盘水市钟山区大湾镇三叉路",LATITUDE:"26.77718",LONGITUDE:"104.61927",IS_EXP:"1"},
                    {LEVEL:2,CUST_CODE:"520201106252",CUST_NAME:"华联万家超市",SHORT_NAME:"钟山",SHOP_NAME:"华联万家超市",SHOP_ID:"17280",ADDRESS:"贵州省六盘水市水城县红桥大道与纸红公路交叉口西南150米",LATITUDE:"26.53705",LONGITUDE:"104.90363",IS_EXP:"1"},
                    {LEVEL:2,CUST_CODE:"520201106397",CUST_NAME:"利邻便利店",SHORT_NAME:"钟山",SHOP_NAME:"利邻便利店",SHOP_ID:"6453",ADDRESS:"贵州省六盘水市钟山区大连路西100米",LATITUDE:"26.56191",LONGITUDE:"104.84193",IS_EXP:"1"},
                    {LEVEL:1,CUST_CODE:"520201106648",CUST_NAME:"双益烟酒副食超市",SHORT_NAME:"钟山",SHOP_NAME:"双益烟酒副食超市",SHOP_ID:"7347",ADDRESS:"贵州省六盘水市钟山区凤凰街道货车绕城环线",LATITUDE:"26.54513",LONGITUDE:"104.87675",IS_EXP:"1"},
                    {LEVEL:1,CUST_CODE:"520201105833",CUST_NAME:"家惠超市",SHORT_NAME:"钟山",SHOP_NAME:"优乐购生活超市",SHOP_ID:"12353",ADDRESS:"贵州省六盘水市钟山区康乐南路5号附近",LATITUDE:"26.59551",LONGITUDE:"104.82549",IS_EXP:"1"},
                    {LEVEL:1,CUST_CODE:"520201104757",CUST_NAME:"惠彦便利店",SHORT_NAME:"钟山",SHOP_NAME:"惠彦便利店",SHOP_ID:"11718",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.56728",LONGITUDE:"104.88375",IS_EXP:"1"},
                    {LEVEL:1,CUST_CODE:"520201106217",CUST_NAME:"大众烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"大众烟酒店",SHOP_ID:"9320",ADDRESS:"北京市东城区东华门街道缎库胡同52号缎库胡同15号院",LATITUDE:"39.91125",LONGITUDE:"116.40589",IS_EXP:"1"},
                    {LEVEL:1,CUST_CODE:"520201100513",CUST_NAME:"宏达烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"薛朝庆",SHOP_ID:"16491",ADDRESS:"贵州省六盘水市钟山区钟山大道与麒麟路交汇处西北侧新世纪大厦一栋一楼118室",LATITUDE:"26.58227",LONGITUDE:"104.86136",IS_EXP:"1"},
                    {LEVEL:1,CUST_CODE:"520201100194",CUST_NAME:"香生博雅烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"香生博雅烟酒店 ",SHOP_ID:"17181",ADDRESS:"贵州省六盘水市钟山区富民路与迎新街交叉口北100米",LATITUDE:"26.58518",LONGITUDE:"104.86",IS_EXP:"1"}

                ];

                map.remove(this.markerList);
                map.clearInfoWindow();
                this.markerList = [];

                if (!dataArray || dataArray.length ==0) {
                    return;
                }

                map.setCenter(new AMap.LngLat(dataArray[0].LONGITUDE,dataArray[0].LATITUDE));
                var markerList=[];
                for (var index in dataArray) {
                    var markeInfo = dataArray[index];


                    var div1 = document.createElement('div');
                    div1.classList.add('dh-container');

                    var div2 = document.createElement('div');
                    div2.classList.add('dot');

                    var div3 = document.createElement('div');
                    div3.classList.add('pulse');

                    var div4 = document.createElement('div');
                    div4.classList.add('pulse1');


                    switch (markeInfo.LEVEL + '') {
                        case '1' :
                            div2.style.border = '1px solid #33ccff';
                            div2.style.backgroundColor = '#33ccff';
                            div3.style.border = '1px solid #3399ff';
                            div3.style.boxShadow = '1px 1px 30px #3399ff';
                            div4.style.border = '1px solid #3399ff';
                            div4.style.boxShadow = '1px 1px 30px #3399ff';
                            break;
                        case '2' :
                            div2.style.border = '1px solid #ff8e00';
                            div2.style.backgroundColor = '#ff8e00';
                            div3.style.border = '1px solid #ff8e00';
                            div3.style.boxShadow = '1px 1px 30px #ff8e00';
                            div4.style.border = '1px solid #ff8e00';
                            div4.style.boxShadow = '1px 1px 30px #ff8e00';
                            break;
                        case '3' :
                            div2.style.border = '1px solid #ff0000';
                            div2.style.backgroundColor = '#ff0000';
                            div3.style.border = '1px solid #ff0000';
                            div3.style.boxShadow = '1px 1px 30px #ff0000';
                            div4.style.border = '1px solid #red';
                            div4.style.boxShadow = '1px 1px 30px #ff0000';
                            break;
                        case '4' :
                            div2.style.border = '1px solid #b0ff33';
                            div2.style.backgroundColor = '#b0ff33';
                            div3.style.border = '1px solid #b0ff33';
                            div3.style.boxShadow = '1px 1px 30px #b0ff33';
                            div4.style.border = '1px solid #b0ff33';
                            div4.style.boxShadow = '1px 1px 30px #b0ff33';
                            break;
                        case '5' :
                            div2.style.border = '1px solid #334cff';
                            div2.style.backgroundColor = '#334cff';
                            div3.style.border = '1px solid #334cff';
                            div3.style.boxShadow = '1px 1px 30px #334cff';
                            div4.style.border = '1px solid #334cff';
                            div4.style.boxShadow = '1px 1px 30px #334cff';
                            break;
                        default :
                    }

                    div1.appendChild(div2);
                    div1.appendChild(div3);
                    div1.appendChild(div4);




                    var marker = new AMap.Marker({
                        content: div1,
                        //icon : icon,//24px*24px
                        position : [markeInfo.LONGITUDE,markeInfo.LATITUDE],
                        title:markeInfo.PLATE_NUMBER,
                        offset : new AMap.Pixel(-24,-24),
                       // animation:'AMAP_ANIMATION_BOUNCE',
                        map : map
                    });



                    marker.content = '专卖证号：'+ markeInfo.CUST_CODE +
                        '<br>客户名称：'+ markeInfo.CUST_NAME +
                        '<br>店铺名称：'+ markeInfo.SHOP_NAME +
                        '<br>是否试点：'+ (markeInfo.IS_EXP == '1' ? '是':'否') +
                        '<br>店铺地址：'+markeInfo.ADDRESS ;

                    AMap.event.addListener(marker, 'click', function(e) {
                        infoWindow.setContent(e.target.content);
                        infoWindow.open(map, e.target.getPosition());


                    });


                    markerList.push(marker);

                }

                this.markerList = markerList;

            },
            updateMain1Data: function (mainData) {
                //虚拟数据
                mainData = [
                    {PRODUCT_NAME:'贵烟(福)',QUANTITY:19873},
                    {PRODUCT_NAME:'贵烟(硬黄精品)',QUANTITY:15873},
                    {PRODUCT_NAME:'贵烟(喜)',QUANTITY:13787},
                    {PRODUCT_NAME:'贵烟(软高遵)',QUANTITY:12873},
                    {PRODUCT_NAME:'贵烟(硬高遵)',QUANTITY:11873},
                    {PRODUCT_NAME:'贵烟(跨越)',QUANTITY:10873},
                    {PRODUCT_NAME:'贵烟(玉液2号)',QUANTITY:8873},
                    {PRODUCT_NAME:'贵烟好彩',QUANTITY:7873},
                    {PRODUCT_NAME:'贵烟(软多彩)',QUANTITY:6873},
                    {PRODUCT_NAME:'黄果树(长征1935)',QUANTITY:5873},
                ];

                /**
                 * 为了解决数据为空的情况，采用如此方法解决
                 * main1Data:[{name:'00:00-05:59',time:12,quantity:200}]
                 *
                 * */
                var prods = [];
                var quantity = [];
                for (var index in mainData) {
                    var data = mainData[index];
                    prods.push(data.PRODUCT_NAME);
                    quantity.push((data.QUANTITY/250).toFixed(2));
                }
                // 指定图表的配置项和数据
                var option = {
                    color: ['#f7a460'],
                    title: {
                        text: '销量前十',
                        textStyle: {
                            color:'#909090'
                        }
                    },
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        textStyle: {
                            color:'#c5c5c5'
                        },
                        data:['销量']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        //bottom: '3%',
                        containLabel: true
                    },
                    toolbox: {
                        feature: {
                            saveAsImage: {}
                        }
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: true,
                        axisLine: {
                            lineStyle: {
                                color: '#0177d4'
                            }
                        },
                        axisLabel: {
                            interval: 0,
                            rotate: 45,
                            show: true,
                            splitNumber: 15,
                            color: '#fff',
                            fontSize: 14
                        },
                        data: prods
                    },
                    yAxis: {
                        name: "（箱）",
                        nameTextStyle: {
                            color: '#77969a',
                            fontSize: 16
                        },
                        axisLine: {
                            lineStyle: {
                                color: '#0177d4'
                            }
                        },
                        axisLabel: {
                            color: '#fff',
                            fontSize: 16
                        },
                        splitLine: {
                            show:false,
                            lineStyle: {
                                color: '#0177d4'
                            }
                        },
                        type: 'value'
                    },
                    series: [
                        {
                            name:'销量',
                            type:'bar',
                            data:quantity
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart1.setOption(option)
            },
            updateMain2Data: function (mainData) {
                //if (!main1Data) return;

                //虚拟数据
                mainData = [
                    {DELIVER_DATE:'201703',QUANTITY:49},
                    {DELIVER_DATE:'201706',QUANTITY:99},
                    {DELIVER_DATE:'201707',QUANTITY:90},
                    {DELIVER_DATE:'201708',QUANTITY:100},
                    {DELIVER_DATE:'201709',QUANTITY:120},
                    {DELIVER_DATE:'201710',QUANTITY:80},
                    {DELIVER_DATE:'201711',QUANTITY:20},
                    {DELIVER_DATE:'201712',QUANTITY:50},
                    {DELIVER_DATE:'201801',QUANTITY:90},
                    {DELIVER_DATE:'201802',QUANTITY:60},
                    {DELIVER_DATE:'201803',QUANTITY:100},
                    {DELIVER_DATE:'201804',QUANTITY:30},

                ];

                /**
                 * 为了解决数据为空的情况，采用如此方法解决
                 * main1Data:[{name:'00:00-05:59',time:12,quantity:200}]
                 *
                 * */
                var months = ['1','2','3','4','5','6','7','8','9','10','11','12'];
                var quantity17 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
                var quantity18 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
                for (var index in mainData) {
                    var data = mainData[index];
                    var year = data.DELIVER_DATE.substring(0, 4);
                    var month = data.DELIVER_DATE.substring(4);
                    var idx;
                    switch (month) {
                        case '01':
                            idx = 0;
                            break;
                        case '02':
                            idx = 1;
                            break;
                        case '03':
                            idx = 2;
                            break;
                        case '04':
                            idx = 3;
                            break;
                        case '05':
                            idx = 4;
                            break;
                        case '06':
                            idx = 5;
                            break;
                        case '07':
                            idx = 6;
                            break;
                        case '08':
                            idx = 7;
                            break;
                        case '09':
                            idx = 8;
                            break;
                        case '10':
                            idx = 9;
                            break;
                        case '11':
                            idx = 10;
                            break;
                        case '12':
                            idx = 11;
                            break;
                        default:
                            ;
                    }
                    if (year == '2017') {
                        quantity17[idx] = (data.QUANTITY/250).toFixed(2);
                    } else if (year == '2018') {
                        quantity18[idx] = (data.QUANTITY/250).toFixed(2);
                    }

                }
                // 指定图表的配置项和数据
                var option = {
                    color: ['#6245f7', '#35b1d2'],
                    title: {
                        text: '年销量',
                        textStyle: {
                            color:'#909090'
                        }
                    },
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        textStyle: {
                            color:'#c5c5c5'
                        },
                        data:['2017','2018']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    toolbox: {
                        feature: {
                            saveAsImage: {}
                        }
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        axisLine: {
                            lineStyle: {
                                color: '#0177d4'
                            }
                        },
                        axisLabel: {
                            color: '#fff',
                            fontSize: 14
                        },
                        data: months
                    },
                    yAxis: {
                        name: "（箱）",
                        nameTextStyle: {
                            color: '#77969a',
                            fontSize: 16
                        },
                        axisLine: {
                            lineStyle: {
                                color: '#0177d4'
                            }
                        },
                        axisLabel: {
                            color: '#fff',
                            fontSize: 16
                        },
                        splitLine: {
                            show:false,
                            lineStyle: {
                                color: '#0177d4'
                            }
                        },
                        type: 'value'
                    },
                    series: [
                        {
                            name:'2017',
                            type:'line',
                            data:quantity17
                        },
                        {
                            name:'2018',
                            type:'line',
                            data:quantity18
                        },
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart2.setOption(option);
            },
            managerAmt: function () {
                var payAmt = this.numData.amt;
                if (!payAmt) {
                    return '0元';
                }
                if (payAmt > 100000000) {
                    return (payAmt / 100000000).toFixed(2) + "亿";
                }
                if (payAmt > 10000) {
                    return (payAmt / 10000).toFixed(2) + "万";
                }
                return payAmt
            }
        }
    });
</script>
</body>
</html>